﻿<?php
	require_once("sys_conf.inc");
	if(isset($_GET[scope])&&isset($_GET[idx])){		
		$scope = $_GET[scope];
		$id = $_GET[idx];
		switch($scope){
			case 'poll':
				$tablename = 'extpollsubject';
				break; 
			case 'option':
				$tablename = 'extpollitems';
				break; 
			case 'media':
				$tablename = 'extpollmedia';
				break; 
		}
		$link_id = mysql_connect($DBHOST,$DBUSER,$DBPWD);
		mysql_select_db($DBNAME);
		mysql_query("SET NAMES 'utf8'");		
		$sql = "DELETE FROM $tablename WHERE id = $id ";
		$result = mysql_query($sql);
	}else{
		 header("Status: 404 Not Found");
	}
?>